import request from "@/utils/request";

const TASK_BASE_URL = "/api/v1/tasks";

const TaskAPI = {
  /**
   * 配送员查询任务列表
   */
  getCourierTaskList(courierId: any) {
    return request<any, any>({
      url: `${TASK_BASE_URL}/courier/list`,
      method: "get",
      params: { courierId: courierId },
    });
  },
  /**
   * 配送员查询任务
   */
  getCourierTask(taskId: any) {
    return request<any, any>({
      url: `${TASK_BASE_URL}/courier/${taskId}`,
      method: "get",
    });
  },
  /**
   * 配送员审核配送任务
   */
  courierAuditTask(data: any) {
    return request<any, any>({
      url: `${TASK_BASE_URL}/courier/audit`,
      method: "post",
      data: data,
    });
  },

  /**
   * 一键计算收益
   */
  calculatePriceAPI(data: any) {
    return request<any, any>({
      url: `${TASK_BASE_URL}/calculate`,
      method: "post",
      data: data,
    });
  },
};

export default TaskAPI;
